// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
#pragma once
#include "LatLon.h"
#include "IWebService.h"

namespace Weathr
{
    namespace Web
    {
        // Represents a physical location on the Earth.
        struct Location
        {
            std::wstring Locality;      // e.g. 'Redmond'
            std::wstring AdminDistrict; // e.g. 'WA'
            std::wstring CountryRegion; // e.g. 'United States'
            Weathr::LatLon Latlon;
        };

        // Interface for retrieving location information from a web service.
        class ILocationService : public IWebService
        {
        public:
            // Retrieves the location at the provided latitude and longitude coordinates.
            virtual concurrency::task<std::shared_ptr<Location>> GetLocationAsync(float32 latitude, float32 longitude) = 0;

            // Retrieves all locations that match the provided string.
            virtual concurrency::task<std::vector<std::shared_ptr<Location>>> GetLocationsAsync(const std::wstring& name) = 0;
        };
    }
}